import { useAuth } from '@/contexts/AuthContext';

export function useHasPermission(requiredRoles: string | string[]): boolean {
  const { user } = useAuth();
  const roles = user?.roles || [];
  const required = Array.isArray(requiredRoles) ? requiredRoles : [requiredRoles];
  return required.length === 0 || required.some(r => roles.includes(r));
}


